home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 4 / Macwelt DVD 4.cdr / Entwickler / Mac-OS / oxygen / oxygen.app / Contents / Resources / Java / oxygen.jar / builtin / XML1998.xsd < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-09  |  18.6 KB  |  490 lines

  1. <?xml version='1.0'?>
  2. <!DOCTYPE xs:schema 
  3. [
  4. <!-- Inclusion of XMLSchema.dtd starts here. tkamiya 2001-08-14 -->
  5.  
  6. <!-- With the exception of cases with multiple namespace
  7.      prefixes for the XML Schema namespace, any XML document which is
  8.      not valid per this DTD given redefinitions in its internal subset of the
  9.      'p' and 's' parameter entities below appropriate to its namespace
  10.      declaration of the XML Schema namespace is almost certainly not
  11.      a valid schema. -->
  12.  
  13. <!-- The simpleType element and its constituent parts
  14.      are defined in XML Schema: Part 2: Datatypes -->
  15.  
  16. <!-- Inclusion of datatypes.dtd starts here. tkamiya 2001-08-14 -->
  17.  
  18. <!-- !ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' -->
  19. <!-- %xs-datatypes; -->
  20.  
  21. <!--
  22.         DTD for XML Schemas: Part 2: Datatypes
  23.         $Id: XML1998.xsd,v 1.1 2002/04/10 12:21:58 george Exp $
  24.         Note this DTD is NOT normative, or even definitive. - - the
  25.         prose copy in the datatypes REC is the definitive version
  26.         (which shouldn't differ from this one except for this comment
  27.         and entity expansions, but just in case)
  28.   -->
  29.  
  30. <!ELEMENT xs:simpleType
  31.         ((xs:annotation)?, (xs:restriction | xs:list | xs:union))>
  32. <!ATTLIST xs:simpleType
  33.     name      NMTOKEN #IMPLIED
  34.     final     CDATA #IMPLIED
  35.     id        ID       #IMPLIED
  36.     >
  37. <!-- name is required at top level -->
  38. <!ELEMENT xs:restriction ((xs:annotation)?,
  39.                          (((xs:all | xs:choice | xs:sequence | xs:group)?) |
  40.                           ((xs:simpleType)?,((xs:minInclusive | xs:minExclusive) | (xs:maxInclusive | xs:maxExclusive) | xs:totalDigits | xs:fractionDigits | xs:pattern | xs:enumeration | xs:whiteSpace | xs:length | xs:maxLength | xs:minLength)*)),
  41.                          (((xs:attribute| xs:attributeGroup)*,(xs:anyAttribute)?)))>
  42. <!ATTLIST xs:restriction
  43.     base      NMTOKEN                  #IMPLIED
  44.     id        ID       #IMPLIED
  45.     >
  46. <!--
  47.         base and simpleType child are mutually exclusive,
  48.         one is required.
  49.  
  50.         restriction is shared between simpleType and
  51.         simpleContent and complexContent (in XMLSchema.xsd).
  52.         restriction1 is for the latter cases, when this
  53.         is restricting a complex type, as is attrDecls.
  54.   -->
  55. <!ELEMENT xs:list ((xs:annotation)?,(xs:simpleType)?)>
  56. <!ATTLIST xs:list
  57.     itemType      NMTOKEN             #IMPLIED
  58.     id        ID       #IMPLIED
  59.     >
  60. <!--
  61.         itemType and simpleType child are mutually exclusive,
  62.         one is required
  63.   -->
  64. <!ELEMENT xs:union ((xs:annotation)?,(xs:simpleType)*)>
  65. <!ATTLIST xs:union
  66.     id            ID       #IMPLIED
  67.     memberTypes   NMTOKENS            #IMPLIED
  68.     >
  69. <!--
  70.         At least one item in memberTypes or one simpleType
  71.         child is required
  72.   -->
  73.  
  74. <!ELEMENT xs:maxExclusive (xs:annotation)?>
  75. <!ATTLIST xs:maxExclusive
  76.         value CDATA #REQUIRED id ID #IMPLIED
  77.         fixed (true|false) #IMPLIED
  78.         >
  79. <!ELEMENT xs:minExclusive (xs:annotation)?>
  80. <!ATTLIST xs:minExclusive
  81.         value CDATA #REQUIRED id ID #IMPLIED
  82.         fixed (true|false) #IMPLIED
  83.         >
  84.  
  85. <!ELEMENT xs:maxInclusive (xs:annotation)?>
  86. <!ATTLIST xs:maxInclusive
  87.         value CDATA #REQUIRED id ID #IMPLIED
  88.         fixed (true|false) #IMPLIED
  89.         >
  90. <!ELEMENT xs:minInclusive (xs:annotation)?>
  91. <!ATTLIST xs:minInclusive
  92.         value CDATA #REQUIRED id ID #IMPLIED
  93.         fixed (true|false) #IMPLIED
  94.         >
  95.  
  96. <!ELEMENT xs:totalDigits (xs:annotation)?>
  97. <!ATTLIST xs:totalDigits
  98.         value CDATA #REQUIRED id ID #IMPLIED
  99.         fixed (true|false) #IMPLIED
  100.         >
  101. <!ELEMENT xs:fractionDigits (xs:annotation)?>
  102. <!ATTLIST xs:fractionDigits
  103.         value CDATA #REQUIRED id ID #IMPLIED
  104.         fixed (true|false) #IMPLIED
  105.         >
  106.  
  107. <!ELEMENT xs:length (xs:annotation)?>
  108. <!ATTLIST xs:length
  109.         value CDATA #REQUIRED id ID #IMPLIED
  110.         fixed (true|false) #IMPLIED
  111.         >
  112. <!ELEMENT xs:minLength (xs:annotation)?>
  113. <!ATTLIST xs:minLength
  114.         value CDATA #REQUIRED id ID #IMPLIED
  115.         fixed (true|false) #IMPLIED
  116.         >
  117. <!ELEMENT xs:maxLength (xs:annotation)?>
  118. <!ATTLIST xs:maxLength
  119.         value CDATA #REQUIRED id ID #IMPLIED
  120.         fixed (true|false) #IMPLIED
  121.         >
  122.  
  123. <!-- This one can be repeated -->
  124. <!ELEMENT xs:enumeration (xs:annotation)?>
  125. <!ATTLIST xs:enumeration
  126.         value CDATA #REQUIRED id ID #IMPLIED
  127.         >
  128.  
  129. <!ELEMENT xs:whiteSpace (xs:annotation)?>
  130. <!ATTLIST xs:whiteSpace
  131.         value CDATA #REQUIRED id ID #IMPLIED
  132.         fixed (true|false) #IMPLIED
  133.         >
  134.  
  135. <!-- This one can be repeated -->
  136. <!ELEMENT xs:pattern (xs:annotation)?>
  137. <!ATTLIST xs:pattern
  138.         value CDATA #REQUIRED id ID #IMPLIED
  139.         >
  140.  
  141. <!-- Inclusion of datatypes.dtd ends here. tkamiya 2001-08-14 -->
  142.  
  143. <!-- the duplication below is to produce an unambiguous content model
  144.      which allows annotation everywhere -->
  145. <!ELEMENT xs:schema ((xs:include | xs:import | xs:redefine | xs:annotation)*,
  146.                     ((xs:simpleType | xs:complexType
  147.                       | xs:element | xs:attribute
  148.                       | xs:attributeGroup | xs:group
  149.                       | xs:notation ),
  150.                      (xs:annotation)*)* )>
  151. <!ATTLIST xs:schema
  152.    targetNamespace      CDATA               #IMPLIED
  153.    version              CDATA                  #IMPLIED
  154.    xmlns:xs                CDATA               #FIXED 'http://www.w3.org/2001/XMLSchema'
  155.    xmlns:co             CDATA                  #FIXED 'http://www.iona.com/2001/XMLSchemaCompanion'
  156.    xmlns                CDATA                  #IMPLIED
  157.    finalDefault         CDATA ''
  158.    blockDefault         CDATA             ''
  159.    id                   ID                     #IMPLIED
  160.    elementFormDefault   (qualified|unqualified)           'unqualified'
  161.    attributeFormDefault (qualified|unqualified)           'unqualified'
  162.    xml:lang             CDATA                  #IMPLIED
  163.    >
  164. <!-- Note the xmlns declaration is NOT in the Schema for Schemas,
  165.      because at the Infoset level where schemas operate,
  166.      xmlns(:prefix) is NOT an attribute! -->
  167. <!-- The declaration of xmlns is a convenience for schema authors -->
  168.  
  169. <!-- The id attribute here and below is for use in external references
  170.      from non-schemas using simple fragment identifiers.
  171.      It is NOT used for schema-to-schema reference, internal or
  172.      external. -->
  173.  
  174. <!-- a type is a named content type specification which allows attribute
  175.      declarations-->
  176. <!-- -->
  177.  
  178. <!ELEMENT xs:complexType ((xs:annotation)?,
  179.                          (xs:simpleContent|xs:complexContent|
  180.                           ((xs:all | xs:choice | xs:sequence | xs:group)?, ((xs:attribute| xs:attributeGroup)*,(xs:anyAttribute)?))))>
  181.  
  182. <!ATTLIST xs:complexType
  183.           name      NMTOKEN                        #IMPLIED
  184.           id        ID                              #IMPLIED
  185.           abstract  (true|false)                       #IMPLIED
  186.           final     CDATA          #IMPLIED
  187.           block     CDATA          #IMPLIED
  188.           mixed (true|false) 'false'
  189.           >
  190.  
  191. <!-- particleAndAttrs is shorthand for a root type -->
  192. <!-- mixed is disallowed if simpleContent, overriden if complexContent
  193.      has one too. -->
  194.  
  195. <!-- If anyAttribute appears in one or more referenced attributeGroups
  196.      and/or explicitly, the intersection of the permissions is used -->
  197.  
  198. <!ELEMENT xs:complexContent (xs:restriction|xs:extension)>
  199. <!ATTLIST xs:complexContent
  200.           mixed (true|false) #IMPLIED
  201.           id    ID           #IMPLIED
  202.           >
  203.  
  204. <!-- restriction should use the branch defined above, not the simple
  205.      one from part2; extension should use the full model  -->
  206.  
  207. <!ELEMENT xs:simpleContent (xs:restriction|xs:extension)>
  208. <!ATTLIST xs:simpleContent
  209.           id    ID           #IMPLIED
  210.           >
  211.  
  212. <!-- restriction should use the simple branch from part2, not the 
  213.      one defined above; extension should have no particle  -->
  214.  
  215. <!ELEMENT xs:extension (((xs:all | xs:choice | xs:sequence | xs:group)?, ((xs:attribute| xs:attributeGroup)*,(xs:anyAttribute)?)))>
  216. <!ATTLIST xs:extension
  217.           base  NMTOKEN      #REQUIRED
  218.           id    ID           #IMPLIED
  219.           >
  220.  
  221. <!-- an element is declared by either:
  222.  a name and a type (either nested or referenced via the type attribute)
  223.  or a ref to an existing element declaration -->
  224.  
  225. <!ELEMENT xs:element ((xs:annotation)?, (xs:complexType| xs:simpleType)?,
  226.                      (xs:unique | xs:key | xs:keyref)*)>
  227. <!-- simpleType or complexType only if no type|ref attribute -->
  228. <!-- ref not allowed at top level -->
  229. <!ATTLIST xs:element
  230.             name               NMTOKEN               #IMPLIED
  231.             id                 ID                     #IMPLIED
  232.             ref                NMTOKEN                #IMPLIED
  233.             type               NMTOKEN                #IMPLIED
  234.             minOccurs          NMTOKEN   #IMPLIED
  235.             maxOccurs          CDATA                  #IMPLIED
  236.             nillable           (true|false)              #IMPLIED
  237.             substitutionGroup  NMTOKEN                #IMPLIED
  238.             abstract           (true|false)              #IMPLIED
  239.             final              CDATA #IMPLIED
  240.             block              CDATA             #IMPLIED
  241.             default            CDATA                  #IMPLIED
  242.             fixed              CDATA                  #IMPLIED
  243.             form               (qualified|unqualified)           #IMPLIED
  244.             >
  245. <!-- type and ref are mutually exclusive.
  246.      name and ref are mutually exclusive, one is required -->
  247. <!-- In the absence of type AND ref, type defaults to type of
  248.      substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
  249. <!-- default and fixed are mutually exclusive -->
  250.  
  251. <!ELEMENT xs:group ((xs:annotation)?,(xs:all | xs:choice | xs:sequence)?)>
  252. <!ATTLIST xs:group 
  253.           name        NMTOKEN               #IMPLIED
  254.           ref         NMTOKEN                #IMPLIED
  255.           minOccurs   NMTOKEN   #IMPLIED
  256.           maxOccurs   CDATA                  #IMPLIED
  257.           id          ID                     #IMPLIED
  258.           >
  259.  
  260. <!ELEMENT xs:all ((xs:annotation)?, (xs:element)*)>
  261. <!ATTLIST xs:all
  262.           minOccurs   (1)                    #IMPLIED
  263.           maxOccurs   (1)                    #IMPLIED
  264.           id          ID                     #IMPLIED
  265.           >
  266.  
  267. <!ELEMENT xs:choice ((xs:annotation)?, (xs:element| xs:group| xs:choice | xs:sequence | xs:any)*)>
  268. <!ATTLIST xs:choice
  269.           minOccurs   NMTOKEN   #IMPLIED
  270.           maxOccurs   CDATA                  #IMPLIED
  271.           id          ID                     #IMPLIED
  272.           >
  273.  
  274. <!ELEMENT xs:sequence ((xs:annotation)?, (xs:element| xs:group| xs:choice | xs:sequence | xs:any)*)>
  275. <!ATTLIST xs:sequence
  276.           minOccurs   NMTOKEN   #IMPLIED
  277.           maxOccurs   CDATA                  #IMPLIED
  278.           id          ID                     #IMPLIED
  279.           >
  280.  
  281. <!-- an anonymous grouping in a model, or
  282.      a top-level named group definition, or a reference to same -->
  283.  
  284. <!-- Note that if order is 'all', group is not allowed inside.
  285.      If order is 'all' THIS group must be alone (or referenced alone) at
  286.      the top level of a content model -->
  287. <!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
  288. <!-- Should allow minOccurs=0 inside order='all' . . . -->
  289.  
  290. <!ELEMENT xs:any (xs:annotation)?>
  291. <!ATTLIST xs:any
  292.             namespace       CDATA                  '##any'
  293.             processContents (skip|lax|strict)      'strict'
  294.             minOccurs       NMTOKEN   '1'
  295.             maxOccurs       CDATA                  '1'
  296.             id              ID                     #IMPLIED
  297.             >
  298.  
  299. <!-- namespace is interpreted as follows:
  300.                   ##any      - - any non-conflicting WFXML at all
  301.  
  302.                   ##other    - - any non-conflicting WFXML from namespace other
  303.                                   than targetNamespace
  304.  
  305.                   ##local    - - any unqualified non-conflicting WFXML/attribute
  306.                   one or     - - any non-conflicting WFXML from
  307.                   more URI        the listed namespaces
  308.                   references
  309.  
  310.                   ##targetNamespace ##local may appear in the above list,
  311.                     with the obvious meaning -->
  312.  
  313. <!ELEMENT xs:anyAttribute (xs:annotation)?>
  314. <!ATTLIST xs:anyAttribute
  315.             namespace       CDATA              '##any'
  316.             processContents (skip|lax|strict)  'strict'
  317.             id              ID                 #IMPLIED
  318.             >
  319. <!-- namespace is interpreted as for 'any' above -->
  320.  
  321. <!-- simpleType only if no type|ref attribute -->
  322. <!-- ref not allowed at top level, name iff at top level -->
  323. <!ELEMENT xs:attribute ((xs:annotation)?, (xs:simpleType)?)>
  324. <!ATTLIST xs:attribute
  325.           name      NMTOKEN      #IMPLIED
  326.           id        ID            #IMPLIED
  327.           ref       NMTOKEN       #IMPLIED
  328.           type      NMTOKEN       #IMPLIED
  329.           use       (prohibited|optional|required) #IMPLIED
  330.           default   CDATA         #IMPLIED
  331.           fixed     CDATA         #IMPLIED
  332.           form      (qualified|unqualified)  #IMPLIED
  333.           >
  334. <!-- type and ref are mutually exclusive.
  335.      name and ref are mutually exclusive, one is required -->
  336. <!-- default for use is optional when nested, none otherwise -->
  337. <!-- default and fixed are mutually exclusive -->
  338. <!-- type attr and simpleType content are mutually exclusive -->
  339.  
  340. <!-- an attributeGroup is a named collection of attribute decls, or a
  341.      reference thereto -->
  342. <!ELEMENT xs:attributeGroup ((xs:annotation)?,
  343.                        (xs:attribute | xs:attributeGroup)*,
  344.                        (xs:anyAttribute)?) >
  345. <!ATTLIST xs:attributeGroup
  346.                  name       NMTOKEN       #IMPLIED
  347.                  id         ID             #IMPLIED
  348.                  ref        NMTOKEN        #IMPLIED
  349.                  >
  350.  
  351. <!-- ref iff no content, no name.  ref iff not top level -->
  352.  
  353. <!-- better reference mechanisms -->
  354. <!ELEMENT xs:unique ((xs:annotation)?, xs:selector, (xs:field)+)>
  355. <!ATTLIST xs:unique
  356.           name     NMTOKEN       #REQUIRED
  357.       id       ID             #IMPLIED
  358.       >
  359.  
  360. <!ELEMENT xs:key    ((xs:annotation)?, xs:selector, (xs:field)+)>
  361. <!ATTLIST xs:key
  362.           name     NMTOKEN       #REQUIRED
  363.       id       ID             #IMPLIED
  364.       >
  365.  
  366. <!ELEMENT xs:keyref ((xs:annotation)?, xs:selector, (xs:field)+)>
  367. <!ATTLIST xs:keyref
  368.           name     NMTOKEN       #REQUIRED
  369.       refer    NMTOKEN        #REQUIRED
  370.       id       ID             #IMPLIED
  371.       >
  372.  
  373. <!ELEMENT xs:selector ((xs:annotation)?)>
  374. <!ATTLIST xs:selector
  375.           xpath CDATA #REQUIRED
  376.           id    ID          #IMPLIED
  377.           >
  378. <!ELEMENT xs:field ((xs:annotation)?)>
  379. <!ATTLIST xs:field
  380.           xpath CDATA #REQUIRED
  381.           id    ID          #IMPLIED
  382.           >
  383.  
  384. <!-- Schema combination mechanisms -->
  385. <!ELEMENT xs:include (xs:annotation)?>
  386. <!ATTLIST xs:include
  387.           schemaLocation CDATA #REQUIRED
  388.           id             ID       #IMPLIED
  389.           >
  390.  
  391. <!ELEMENT xs:import (xs:annotation)?>
  392. <!ATTLIST xs:import
  393.           namespace      CDATA #IMPLIED
  394.           schemaLocation CDATA #IMPLIED
  395.           id             ID       #IMPLIED
  396.           >
  397.  
  398. <!ELEMENT xs:redefine (xs:annotation | xs:simpleType | xs:complexType |
  399.                       xs:attributeGroup | xs:group)*>
  400. <!ATTLIST xs:redefine
  401.           schemaLocation CDATA #REQUIRED
  402.           id             ID       #IMPLIED
  403.           >
  404.  
  405. <!ELEMENT xs:notation (xs:annotation)?>
  406. <!ATTLIST xs:notation
  407.       name        NMTOKEN    #REQUIRED
  408.       id          ID          #IMPLIED
  409.       public      CDATA       #REQUIRED
  410.       system      CDATA    #IMPLIED
  411.       >
  412.  
  413. <!-- Annotation is either application information or documentation -->
  414. <!-- By having these here they are available for datatypes as well
  415.      as all the structures elements -->
  416.  
  417. <!ELEMENT xs:annotation (xs:appinfo | xs:documentation)*>
  418.  
  419. <!-- User must define annotation elements in internal subset for this
  420.      to work -->
  421. <!ELEMENT xs:appinfo ANY>   <!-- too restrictive -->
  422. <!ATTLIST xs:appinfo
  423.           source     CDATA      #IMPLIED
  424.           id         ID         #IMPLIED
  425.           >
  426. <!ELEMENT xs:documentation ANY>   <!-- too restrictive -->
  427. <!ATTLIST xs:documentation
  428.           source     CDATA   #IMPLIED
  429.           id         ID         #IMPLIED
  430.           xml:lang   CDATA      #IMPLIED
  431.           >
  432.  
  433. <!NOTATION XMLSchemaStructures PUBLIC
  434.            'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >
  435. <!NOTATION XML PUBLIC
  436.            'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >
  437.  
  438. <!-- Inclusion of XMLSchema.dtd ends here. tkamiya 2001-08-14 -->
  439. ]
  440. >
  441. <!-- xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en" -->
  442. <xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en"
  443.            xmlns:xml="http://www.w3.org/XML/1998/namespace">
  444.  <xs:annotation>
  445.   <xs:documentation>This schema defines attributes and an attribute group
  446.         suitable for use by
  447.         schemas wishing to allow xml:lang or xml:space attributes
  448.         on elements they define.
  449.  
  450.         To enable this, such a schema must import this schema
  451.         for the XML namespace, e.g. as follows:
  452.         <schema . . .>
  453.          . . .
  454.          <import namespace="http://www.w3.org/XML/1998/namespace"
  455.                     schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
  456.  
  457.         Subsequently, qualified reference to either of the attributes
  458.         or the group defined below will have the desired effect, e.g.
  459.  
  460.         <type . . .>
  461.          . . .
  462.          <attributeGroup ref="xml:specialAttrs"/>
  463.  
  464.          will define a type which will schema-validate a instance
  465.          element with both xml:space and xml:lang attribute</xs:documentation>
  466.  </xs:annotation>
  467.  
  468.  <xs:attribute name="lang" type="xs:language">
  469.   <xs:annotation>
  470.    <xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter
  471.          codes as the enumerated possible values . . .</xs:documentation>
  472.   </xs:annotation>
  473.  </xs:attribute>
  474.  
  475.  <xs:attribute name="space" default="preserve">
  476.   <xs:simpleType>
  477.    <xs:restriction base="xs:NCName">
  478.     <xs:enumeration value="default"/>
  479.     <xs:enumeration value="preserve"/>
  480.    </xs:restriction>
  481.   </xs:simpleType>
  482.  </xs:attribute>
  483.  
  484.  <xs:attributeGroup name="specialAttrs">
  485.   <xs:attribute ref="xml:lang"/>
  486.   <xs:attribute ref="xml:space"/>
  487.  </xs:attributeGroup>
  488.  
  489. </xs:schema>
  490.